﻿using System;
using System.Windows;
using System.Windows.Markup;
using WpfLoginApp;

namespace Khrulenko___Lukyanov_WPF
{
    /// <summary>
    /// Логика взаимодействия для Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {

        public Window1()
        {
            InitializeComponent();
            RegistrationButton.Click += RegisterButton_Click;
            CancelButton.Click += CancelButton_Click;
        }

        private void RegisterButton_Click(object sender, RoutedEventArgs e)
        {
            ((MainWindow)Application.Current.MainWindow).UserName = NameUser.Text;
            ((MainWindow)Application.Current.MainWindow).UserWeight = WeightUser.Text;
            ((MainWindow)Application.Current.MainWindow).UserHeight = RostUser.Text;
            ((MainWindow)Application.Current.MainWindow).UserVozrast = User.Text;
            ((MainWindow)Application.Current.MainWindow).UserIMT = IMTBlock.Text;
            ((MainWindow)Application.Current.MainWindow).UserMeta = MetaBlock.Text;

            this.Close();
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

    }
}
